# coding=utf-8

import unittest
from common.order.handler import get_order

SUCCESS = 2
MANUAL_SUCCESS = 4

class test_api_charge(unittest.TestCase):
    def test_query_manual_success_success(self):
        order = get_order(9990001, '1672326307268001792')
        self.assertEqual(SUCCESS, order['pay_result'])

    def test_query_success_success(self):
        order = get_order(9990001, '1661939881750937600')
        self.assertEqual(SUCCESS, order['pay_result'])

    def test_query_manual_success_failed(self):
        order = get_order(9990001, '1672326307268001792')
        self.assertNotEqual(MANUAL_SUCCESS, order['pay_result'])

if __name__ == '__main__':
    unittest.main()
